package com.example.huainanlive.ui

import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import androidx.lifecycle.ViewModelProvider

class HomeRunViewModel : ViewModel() {
    var totalPage = 2
    val pageIndex = MutableLiveData<Int>()
    val isRefreshData = MutableLiveData<Int>()
    var pageNumber = MutableLiveData<Int>()


    fun updateRefreshData(value: Int) {
        isRefreshData.value = value
    }

    fun getPageNumber(): Int? {
        return pageNumber.value
    }

    fun setPageNumber(Numbers: Int) {
        pageNumber.value = Numbers
    }

    fun getRefreshData(): Int? {
        return isRefreshData.value
    }
}

class HomeRunViewModelFactory : ViewModelProvider.Factory {
    override fun <T : ViewModel> create(modelClass: Class<T>): T {
        return HomeRunViewModel() as T
    }
}